package com.runing.controller;


import com.runing.config.ResponseWrapper;
import com.runing.entity.RVersion;
import com.runing.service.impl.RVersionServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lel
 * @since 2021-03-11
 */
@RestController
@RequestMapping("/rVersion")
@Api(tags = "app版本号管理")
public class RVersionController {

    @Autowired
    RVersionServiceImpl versionService;

    @ApiOperation("修改版本号")
    @PutMapping("/updateVersion")
    public ResponseWrapper updateVersion(@RequestBody RVersion rVersion){
        ResponseWrapper wrapper = versionService.updateVersion(rVersion);
        return wrapper;
    }

    @ApiOperation("查看最新版本号")
    @GetMapping("/selectMobileVersion")
    public ResponseWrapper findVersion(){
        ResponseWrapper wrapper = versionService.findVersion();
        return wrapper;
    }
}

